package com.novax.ex.activity.provider.handler.consumer;

import com.novax.ex.activity.provider.service.UserBigdataService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

import jakarta.annotation.Resource;

/**
 * @description:
 * @author: Wade
 * @date: 10/24/24 2:56 PM
 * @param:
 * @return:
 **/
@Component
@Slf4j
public class UserBigdataConsumer {
    @Resource
    private UserBigdataService userBigdataService;

    @KafkaListener(id = "user", groupId = "user_beeb",
            topics = "user", idIsGroup = false)
    public void exec(String message) {
        try {
            if (StringUtils.isNotBlank(message)){
                userBigdataService.execBigData(message);
            }
        } catch (Exception e) {
            log.info(e.toString());
            log.info("消息队列丢失消息:" + message);
        }
    }
}
